import { createRouter, createWebHistory } from 'vue-router'
import LoginView from '../views/LoginView.vue'
import RegisterView from '../views/RegisterView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/prompt'
    },
    {
      path: '/prompt',
      name: 'prompt',
      component: () => import('../views/PromptPage.vue')
    },
    {
      path: '/login',
      name: 'login',
      component: LoginView
    },
    {
      path: '/register',
      name: 'register',
      component: RegisterView
    },
    {
      path: '/home',
      name: 'home',
      component: () => import('../views/HomeView.vue')
    },
    {
      path: '/city',
      name: 'city',
      component: () => import('../components/city/CityList.vue')
    },
    {
      path: '/map',
      name: 'map',
      component: () => import('../views/map/IndexView.vue')
    },
    {
      path: '/tishi',
      name: 'tishi',
      component: () => import('../components/home/TishiView.vue')
    },
    {
      path: '/analyse',
      children:[
        {
          path:"",
          name: 'analyse',
          component: () => import('../views/analyse/IndexView.vue'),
        },
        {
          path:"calendar",
          name:"calendar",
          component:()=>import('../views/analyse/calendar/IndexView.vue')
        },
        {
          path:"cityrank",
          name:"cityrank",
          component:()=>import('../views/analyse/rank/IndexView.vue')
        },
        {
          path:"citylist",
          name:"citylist",
          component:()=>import('../views/analyse/cityList/IndexView.vue')
        },
        {
          path:"vscity",
          name:"vscity",
          component:()=>import('../views/analyse/VsCity/IndexView.vue')
        },
        {
          path:"selects",
          name:"selects",
          component:()=>import('../views/analyse/cityList/cityComp.vue')
        }
      ]
    },
    {
      path: '/about',
      name: 'about',
      component: () => import('../views/AboutView.vue')
    }
  ]
})

export default router
